/*-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License.You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
	
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
	
The Original Code is Fever RS ( ActionScript 3 ) Framework code.
	
The Initial Developer of the Original Code is Romain Ecarnot.
Portions created by Initial Developer are Copyright (C) 2006
the Initial Developer. All Rights Reserved.
	
Contributor(s):
	
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-----------------------------------------------------------------------------*/

package fever.log 
{
	import com.bourre.events.EventChannel;
	import com.bourre.log.Logger;	

	/**
	 * Logs message into dedicated <strong>Fever</strong> Logging channel.
	 * 
	 * @author Romain Ecarnot
	 */
	public class FeverDebug 
	{

		//-------------------------------------------------------------------------
		// Private implementation
		//-------------------------------------------------------------------------

		private static var _CHANNEL : EventChannel;

		
		//-------------------------------------------------------------------------
		// Public properties
		//-------------------------------------------------------------------------
		
		/**
		 * Channel is available or not.
		 * 
		 * @default true
		 */
		public static var isOn : Boolean = true;
		
		
		//-------------------------------------------------------------------------
		// Public API
		//-------------------------------------------------------------------------
		
		/**
		 * Returns singleton access to Fever channel.
		 */
		public static function get CHANNEL() : EventChannel 
		{
			if ( !FeverDebug._CHANNEL ) 
				FeverDebug._CHANNEL = new FeverDebugChannel( );
			
			return FeverDebug._CHANNEL;
		}
		
		/**
		 * Logs a <italic>debug</italic> message type throw logging API.
		 * 
		 * @param o Message to log
		 */
		public static function DEBUG( o : * ) : void
		{
			if ( FeverDebug.isOn ) Logger.DEBUG( o, FeverDebug.CHANNEL );
		}
		
		/**
		 * Logs an <italic>information</italic> message type throw logging API.
		 * 
		 * @param o Message to log
		 */
		public static function INFO( o : * ) : void
		{
			if ( FeverDebug.isOn ) Logger.INFO( o, FeverDebug.CHANNEL );
		}

		/**
		 * Logs a <italic>warning</italic> message type throw logging API.
		 * 
		 * @param o Message to log
		 */
		public static function WARN( o : * ) : void
		{
			if ( FeverDebug.isOn ) Logger.WARN( o, FeverDebug.CHANNEL );
		}
	
		/**
		 * Logs an <italic>error</italic> message type throw logging API.
		 * 
		 * @param o Message to log
		 */
		public static function ERROR( o : * ) : void
		{
			if ( FeverDebug.isOn ) Logger.ERROR( o, FeverDebug.CHANNEL );
		}
		
		/**
		 * Logs a <italic>fatal</italic> message type throw logging API.
		 * 
		 * @param o Message to log
		 */
		public static function FATAL( o : * ) : void
		{
			if ( FeverDebug.isOn ) Logger.FATAL( o, FeverDebug.CHANNEL );
		}

		
		//-------------------------------------------------------------------------
		// Private implementation
		//-------------------------------------------------------------------------
		
		/** @private */
		public function FeverDebug( acess : PrivateConstructorAccess ) 
		{
		}
	}
}

import com.bourre.events.EventChannel;


internal class FeverDebugChannel extends EventChannel
{
}

internal class PrivateConstructorAccess 
{
}
